home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
comm
/
bbs
/
TIS107.lha
/
SQ.doc
< prev
next >
Wrap
Text File
|
1993-02-12
|
3KB
|
62 lines
"SQ", Question Sort/Validation Utility
for use with
The Immortal Struggle
Created, programmed and copyright (C)1993 by Chris Rea [UL]
A multiplayer online game for BBX, DLG-Pro, FalconCBCS, and Xenolink
Release Date: 12-Feb-93
How To Use SQ
-------------------------------------------------------------------------------
SQ (which stands for Sort Questions) is a small utility for use in
conjunction with The Immortal Struggle online game. SQ will sort, validate,
and truncate all records found in the specified file and output the results to
two other files.
SQ takes a single command line argument: the filename to validate,
truncate, and sort. SQ will output the sorted, valid records to a file named
like the initial filename but with ".sorted" appended. SQ will output the
invalid, failed questions to a file named like the initial filename but with
".failed" appended.
SQ will start by copying everything up to the first record separator bar
("---") to the new sorted file. For example, with the default T.I.S. question
data file, information on format is stored here. Next, SQ will read into
memory each record, and only keep those which pass the validation check.
The validation check is simple. Records with questions larger than 76
characters are tossed into the failure file. Records with answers larger than
39 characters are tossed into the failure file. Records whose question and/or
answer do not conform to the acceptable character range for questions and
answers will also be tossed into the failure file. Also, answers beginning
with "A " or "THE " are also tossed into the failure file, since such answers
are ambiguous and not in proper format.
Any lines coming after the Answer line but before the question separator
bar ("---") will not be stored in memory. This is the "truncate" operation
described above. When a player uses the SUGGEST incantation from with T.I.S.,
their entity name is automatically added after the answer so that ambiguous
questions may be properly verified. Using SQ, these extraneous lines are
removed if present.
After the scan of the question file is complete, SQ sorts (using
quicksort) the records that were valid and stored in memory. SQ sorts with the
answer as the primary sort key and the question as the secondary sort key. The
records are then written out to the sorted file, and SQ is finished.
You will want to examine the failure file to see what exactly the problems
were with certain questions. You may want to fix and append them back to the
question file for another run through SQ. In any case, rename your sorted
master question file back to "TIS_Questions.dat" so that The Immortal Struggle
may have access to these valid questions. Do NOT run T.I.S. with an invalid
question file. It isn't harmful or crash-prone in such a situation--it's just
that people won't be able to answer the questions if they appear munged or if
the answer contains characters that they can't type, etc.
Have fun!
-------------------------------------------------------------------------------
END OF FILE
-------------------------------------------------------------------------------